import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const ToName = 'name'
const ToId = 'id'
const ToRole = 'role'
const ToCropName = 'cropName'

export function getToken() {
  return Cookies.get(TokenKey)
}
export function getId(){
  return Cookies.get(ToId);
}
export function getName(){
  return Cookies.get(ToName);
}
export function getRole(){
  return Cookies.get(ToRole);
}
export function getCropName(){
  return Cookies.get(ToCropName);
}
export function setToken(token,id,name,role) {
  Cookies.set(TokenKey, token);
  Cookies.set(ToId,id);
  Cookies.set(ToName,name);
  Cookies.set(ToRole,role);
}
export function setCropName(cropName){
  Cookies.set(ToCropName,cropName);
}
export function removeToken() {
  Cookies.remove(TokenKey);
  Cookies.remove(ToCropName);
  Cookies.remove(ToId);
  Cookies.remove(ToName);
  Cookies.remove(ToRole);
}
 